const app = getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {
    publicUrl: app.globalData.publicUrl,
    //底部导航
    navbar1: [
      {
        name: '广场',
        icon: '/pages/image/squire2.png'
      },
    ],
    navbar2: [
      {
        name: '我的',
        icon: '/pages/image/our1.png'
      }
    ],
    personlist:[
      {
        name:'我的发布',
        icon:'/pages/image/fabu.png',
        url: '../myrelease/myrelease?release=1' +'&currentTab=0',
        line:''
      },
      {
        name: '我的接单',
        icon: '/pages/image/dan.png',
        url: '/pages/order/order?status=1' +'&currentTab=0',
        line:''
      },
      {
        name: '关于我们',
        icon: '/pages/image/about.png',
        url: '../about/about',
        line:'1'
      }
    ],
    userInfo: {},
    hasUserInfo: false,
    canIUse: wx.canIUse('button.open-type.getUserInfo'),
    tel:''
  },
  privates: function () {
    
    wx.navigateTo({
      url: '../private/private',
    })
  },
  tableft:function(){
    wx.reLaunch({
      url: '/pages/index/index',
    })
  },
  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    
    var that = this
 
   
  },
  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    var that = this
    
    wx.request({
      url: that.data.publicUrl + 'user_info',
      method: 'POST',
      header: {
        'content-type': 'application/x-www-form-urlencoded'
      },
      data: {
        id: wx.getStorageSync('uid')
      },
      success: function (res) {
        console.log(res)

        that.setData({
          list: res.data.data,
          // urlimg: res.data.data.img,
          // nickname: res.data.data.nickname,
          // tel: res.data.data.tel
          tel: res.data.data.tel.substr(0, 3) + "****" + res.data.data.tel.substr(7)
        })
        console.log(res.data.data.img);
      },
      fail: function (res) {
        console.log('加载失败')
      }
    }) 
  },
})